/**
 * 话题分类模型
 */

var mongoose = require("../config/db");

var cateSchema = new mongoose.Schema({
    //分类名称, 唯一
    catename:{
        type: String,
        unique: true
    },
    //排序序号 数值越小靠前显示
    ordernumber: {
        type: Number,
        default: 999
    },
    //选项 从现在话题关联分类的标志 唯一
    tab: {
        type: String,
        unique: true
    }
});

var cateModel = mongoose.model('cate',cateSchema);

/* var cates = [
    {
        catename: 'Share',
        ordernumber: 1,
        tab: 'share'
    },
    {
        catename: 'Ask',
        ordernumber: 2,
        tab: 'ask'
    },
    {
        catename: 'Job',
        ordernumber: 3,
        tab: 'job'
    },
    {
        catename: 'Client Test',
        ordernumber: 4,
        tab: 'test'
    },
    {
        catename: 'News',
        ordernumber: 5,
        tab: 'news'
    },
];

cateModel.create(cates,function(err,msg){
    console.log(err);
    console.log(msg);
}); */

module.exports = cateModel;

